﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/MainSite.Master" AutoEventWireup="true"
    CodeBehind="mailPage.aspx.cs" Inherits="whatpricemyhouse.mailPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="agentNameHolder">
        <div class="agentList1">
            <div class="agentDetail">
                <div class="agentDetailHeader">
                </div>
                <div class="agentDetailHolder">
                    <asp:Image ID="Image1" runat="server" Width="100" Height="120" /><br />
                    <asp:Label ID="nameLabel1" runat="server" Text=""></asp:Label><br />
                    <b>Telephone:</b><br />
                    <asp:Label ID="phoneLabel1" runat="server" Text=""></asp:Label><br />
                    <b>Mobile:</b><br />
                    <asp:Label ID="mobileLabel1" runat="server" Text=""></asp:Label><br />
                    <b>Facsimile:</b><br />
                    <asp:Label ID="facsimileLabel1" runat="server" Text=""></asp:Label><br />
                </div>
                <div class="agentDetailFooter">
                </div>
            </div>
            <div id="mailBody">
                <asp:Label ID="body" runat="server" Text="Label"></asp:Label>
            </div>
            <div style="clear: both;">
            </div>
            <div class="propertyComparisonList" style="padding-left:0px;">
                <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1" EnableModelValidation="True"
                    DataKeyNames="propertyID">
                    <AlternatingItemTemplate>
                        <div class="propertyList">
                            <div class="leftHolder">
                                <div class="idNumber">
                                    &nbsp;&nbsp; #<asp:Label ID="Label1" runat="server" Text='<%# Eval("no") %>' />
                                </div>
                                <div class="image">
                                    <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("imageUrl") %>' />
                                </div>
                            </div>
                            <div class="rightHolder">
                                <div class="lines">
                                    <div class="line1">
                                        <asp:Label ID="PlaceNameLabel" runat="server" Text='<%# Eval("suburb") %>' />
                                    </div>
                                    <div class="line2">
                                        <asp:Label ID="streetNumLabel" runat="server" Text='<%# Eval("streetNum") %>' />
                                        &nbsp;<asp:Label ID="addressLabel" runat="server" Text='<%# Eval("address") %>' />
                                    </div>
                                    <div class="line3">
                                        <asp:Label ID="dateOfSaleLabel" runat="server" Text='<%# Eval("dateOfSale") %>' />
                                        -
                                        <asp:Label ID="priceLabel" runat="server" Text='<%# Eval("price") %>' />
                                    </div>
                                    <div class="line4">
                                        <asp:Label ID="descriptionLabel" runat="server" Text='<%# Eval("description") %>' />
                                    </div>
                                </div>
                            </div>
                        </div>
                    </AlternatingItemTemplate>
                    <EditItemTemplate>
                        <span style="background-color: #008A8C; color: #FFFFFF;">propertyID:
                            <asp:Label ID="propertyIDLabel1" runat="server" Text='<%# Eval("propertyID") %>' />
                            <br />
                            placeID:
                            <asp:TextBox ID="placeIDTextBox" runat="server" Text='<%# Bind("placeID") %>' />
                            <br />
                            otherLocation:
                            <asp:TextBox ID="otherLocationTextBox" runat="server" Text='<%# Bind("otherLocation") %>' />
                            <br />
                            streetNum:
                            <asp:TextBox ID="streetNumTextBox" runat="server" Text='<%# Bind("streetNum") %>' />
                            <br />
                            address:
                            <asp:TextBox ID="addressTextBox" runat="server" Text='<%# Bind("address") %>' />
                            <br />
                            status:
                            <asp:TextBox ID="statusTextBox" runat="server" Text='<%# Bind("status") %>' />
                            <br />
                            dateOfSale:
                            <asp:TextBox ID="dateOfSaleTextBox" runat="server" Text='<%# Bind("dateOfSale") %>' />
                            <br />
                            price:
                            <asp:TextBox ID="priceTextBox" runat="server" Text='<%# Bind("price") %>' />
                            <br />
                            description:
                            <asp:TextBox ID="descriptionTextBox" runat="server" Text='<%# Bind("description") %>' />
                            <br />
                            imageUrl:
                            <asp:TextBox ID="imageUrlTextBox" runat="server" Text='<%# Bind("imageUrl") %>' />
                            <br />
                            SSIID:
                            <asp:TextBox ID="SSIIDTextBox" runat="server" Text='<%# Bind("SSIID") %>' />
                            <br />
                            UserId:
                            <asp:TextBox ID="UserIdTextBox" runat="server" Text='<%# Bind("UserId") %>' />
                            <br />
                            createDate:
                            <asp:TextBox ID="createDateTextBox" runat="server" Text='<%# Bind("createDate") %>' />
                            <br />
                            <asp:CheckBox ID="isOldCheckBox" runat="server" Checked='<%# Bind("isOld") %>' Text="isOld" />
                            <br />
                            no:
                            <asp:Label ID="noLabel1" runat="server" Text='<%# Eval("no") %>' />
                            <br />
                            PlaceName:
                            <asp:TextBox ID="PlaceNameTextBox" runat="server" Text='<%# Bind("PlaceName") %>' />
                            <br />
                            <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
                            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
                            <br />
                            <br />
                        </span>
                    </EditItemTemplate>
                    <EmptyDataTemplate>
                        <span>No data was returned.</span>
                    </EmptyDataTemplate>
                    <InsertItemTemplate>
                        <span style="">propertyID:
                            <asp:TextBox ID="propertyIDTextBox" runat="server" Text='<%# Bind("propertyID") %>' />
                            <br />
                            placeID:
                            <asp:TextBox ID="placeIDTextBox" runat="server" Text='<%# Bind("placeID") %>' />
                            <br />
                            otherLocation:
                            <asp:TextBox ID="otherLocationTextBox" runat="server" Text='<%# Bind("otherLocation") %>' />
                            <br />
                            streetNum:
                            <asp:TextBox ID="streetNumTextBox" runat="server" Text='<%# Bind("streetNum") %>' />
                            <br />
                            address:
                            <asp:TextBox ID="addressTextBox" runat="server" Text='<%# Bind("address") %>' />
                            <br />
                            status:
                            <asp:TextBox ID="statusTextBox" runat="server" Text='<%# Bind("status") %>' />
                            <br />
                            dateOfSale:
                            <asp:TextBox ID="dateOfSaleTextBox" runat="server" Text='<%# Bind("dateOfSale") %>' />
                            <br />
                            price:
                            <asp:TextBox ID="priceTextBox" runat="server" Text='<%# Bind("price") %>' />
                            <br />
                            description:
                            <asp:TextBox ID="descriptionTextBox" runat="server" Text='<%# Bind("description") %>' />
                            <br />
                            imageUrl:
                            <asp:TextBox ID="imageUrlTextBox" runat="server" Text='<%# Bind("imageUrl") %>' />
                            <br />
                            SSIID:
                            <asp:TextBox ID="SSIIDTextBox" runat="server" Text='<%# Bind("SSIID") %>' />
                            <br />
                            UserId:
                            <asp:TextBox ID="UserIdTextBox" runat="server" Text='<%# Bind("UserId") %>' />
                            <br />
                            createDate:
                            <asp:TextBox ID="createDateTextBox" runat="server" Text='<%# Bind("createDate") %>' />
                            <br />
                            <asp:CheckBox ID="isOldCheckBox" runat="server" Checked='<%# Bind("isOld") %>' Text="isOld" />
                            <br />
                            PlaceName:
                            <asp:TextBox ID="PlaceNameTextBox" runat="server" Text='<%# Bind("PlaceName") %>' />
                            <br />
                            <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" />
                            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Clear" />
                            <br />
                            <br />
                        </span>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <div class="propertyList">
                            <div class="leftHolder">
                                <div class="idNumber">
                                    &nbsp;&nbsp;#<asp:Label ID="Label1" runat="server" Text='<%# Eval("no") %>' />
                                </div>
                                <div class="image">
                                    <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("imageUrl") %>' />
                                </div>
                            </div>
                            <div class="rightHolder">
                                <div class="lines">
                                    <div class="line1">
                                        <asp:Label ID="PlaceNameLabel" runat="server" Text='<%# Eval("suburb") %>' />
                                    </div>
                                    <div class="line2">
                                        <asp:Label ID="streetNumLabel" runat="server" Text='<%# Eval("streetNum") %>' />
                                        &nbsp;<asp:Label ID="addressLabel" runat="server" Text='<%# Eval("address") %>' />
                                    </div>
                                    <div class="line3">
                                        <asp:Label ID="dateOfSaleLabel" runat="server" Text='<%# Eval("dateOfSale") %>' />
                                        -
                                        <asp:Label ID="priceLabel" runat="server" Text='<%# Eval("price") %>' />
                                    </div>
                                    <div class="line4">
                                        <asp:Label ID="descriptionLabel" runat="server" Text='<%# Eval("description") %>' />
                                    </div>
                                </div>
                            </div>
                        </div>
                    </ItemTemplate>
                    <LayoutTemplate>
                        <div id="itemPlaceholderContainer" runat="server" style="font-family: Verdana, Arial, Helvetica, sans-serif;">
                            <span runat="server" id="itemPlaceholder" />
                        </div>
                        <div class="pager">
                            <asp:DataPager ID="DataPager1" runat="server" PageSize="1">
                                <Fields>
                                    <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="False" ShowNextPageButton="False"
                                        ShowPreviousPageButton="False" />
                                    <asp:NumericPagerField />
                                    <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="False" ShowNextPageButton="False"
                                        ShowPreviousPageButton="False" />
                                </Fields>
                            </asp:DataPager>
                        </div>
                    </LayoutTemplate>
                    <SelectedItemTemplate>
                        <span style="background-color: #008A8C; font-weight: bold; color: #FFFFFF;">propertyID:
                            <asp:Label ID="propertyIDLabel" runat="server" Text='<%# Eval("propertyID") %>' />
                            <br />
                            placeID:
                            <asp:Label ID="placeIDLabel" runat="server" Text='<%# Eval("placeID") %>' />
                            <br />
                            otherLocation:
                            <asp:Label ID="otherLocationLabel" runat="server" Text='<%# Eval("otherLocation") %>' />
                            <br />
                            streetNum:
                            <asp:Label ID="streetNumLabel" runat="server" Text='<%# Eval("streetNum") %>' />
                            <br />
                            address:
                            <asp:Label ID="addressLabel" runat="server" Text='<%# Eval("address") %>' />
                            <br />
                            status:
                            <asp:Label ID="statusLabel" runat="server" Text='<%# Eval("status") %>' />
                            <br />
                            dateOfSale:
                            <asp:Label ID="dateOfSaleLabel" runat="server" Text='<%# Eval("dateOfSale") %>' />
                            <br />
                            price:
                            <asp:Label ID="priceLabel" runat="server" Text='<%# Eval("price") %>' />
                            <br />
                            description:
                            <asp:Label ID="descriptionLabel" runat="server" Text='<%# Eval("description") %>' />
                            <br />
                            imageUrl:
                            <asp:Label ID="imageUrlLabel" runat="server" Text='<%# Eval("imageUrl") %>' />
                            <br />
                            SSIID:
                            <asp:Label ID="SSIIDLabel" runat="server" Text='<%# Eval("SSIID") %>' />
                            <br />
                            UserId:
                            <asp:Label ID="UserIdLabel" runat="server" Text='<%# Eval("UserId") %>' />
                            <br />
                            createDate:
                            <asp:Label ID="createDateLabel" runat="server" Text='<%# Eval("createDate") %>' />
                            <br />
                            <asp:CheckBox ID="isOldCheckBox" runat="server" Checked='<%# Eval("isOld") %>' Enabled="false"
                                Text="isOld" />
                            <br />
                            no:
                            <asp:Label ID="noLabel" runat="server" Text='<%# Eval("no") %>' />
                            <br />
                            PlaceName:
                            <asp:Label ID="PlaceNameLabel" runat="server" Text='<%# Eval("PlaceName") %>' />
                            <br />
                            <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="Delete" />
                            <br />
                            <br />
                        </span>
                    </SelectedItemTemplate>
                </asp:ListView>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:WhatPriceMyHouseConnectionString %>"
                    SelectCommand="SELECT market_comparison_property_table.propertyID, market_comparison_property_table.otherLocation, market_comparison_property_table.streetNum, market_comparison_property_table.address, market_comparison_property_table.status, market_comparison_property_table.dateOfSale, market_comparison_property_table.price, market_comparison_property_table.description, market_comparison_property_table.imageUrl, market_comparison_property_table.SSIID, market_comparison_property_table.UserId, market_comparison_property_table.createDate, market_comparison_property_table.isOld, market_comparison_property_table.no, suburbs.suburb, suburbs.area FROM market_comparison_property_table INNER JOIN suburbs ON market_comparison_property_table.suburbid = suburbs.suburbid WHERE (suburbs.area LIKE @area) ORDER BY market_comparison_property_table.no DESC"
                    ConflictDetection="CompareAllValues" DeleteCommand="DELETE FROM [market_comparison_property_table] WHERE [propertyID] = @original_propertyID"
                    OldValuesParameterFormatString="original_{0}">
                    <DeleteParameters>
                        <asp:Parameter Name="original_propertyID" Type="String" />
                    </DeleteParameters>
                    <SelectParameters>
                        <asp:SessionParameter DefaultValue="auckland" Name="area" SessionField="areaName" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </div>
        </div>
    </div>
</asp:Content>
